package com.ruoyi.business.dao;

import com.ruoyi.business.domain.Inventory;
import org.springframework.data.repository.query.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;


/**
 * InventoryDao接口
 *
 * @author liutietou
 * @since 1.0 2025-06-22
 */
@Repository
public interface InventoryDao extends JpaRepository<Inventory, String>, JpaSpecificationExecutor<Inventory> {

    @Query(value = "select  isnull(s.idisrate,100)  as rate from  SA_ClassDisRate   s   LEFT JOIN   sys_user   u   ON  u.ccuscode=s.cCusCode  " +
            "WHERE  u.user_id=:userid",nativeQuery = true)
    BigDecimal getCustomerRate(@Param("userid") Long  userid);



}
